3.39 \(\int \cot ^2(c+d x) (a+i a \tan (c+d x))^4 \, dx\)

Optimal. Leaf size=71 \[ \frac {4 i a^4 \log (\sin (c+d x))}{d}+\frac {4 i a^4 \log (\cos (c+d x))}{d}-8 a^4 x-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d} \]

[Out]

-8*a^4*x+4*I*a^4*ln(cos(d*x+c))/d+4*I*a^4*ln(sin(d*x+c))/d-cot(d*x+c)*(a^2+I*a^2*tan(d*x+c))^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3553, 12, 3541, 3475} \[ \frac {4 i a^4 \log (\sin (c+d x))}{d}+\frac {4 i a^4 \log (\cos (c+d x))}{d}-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-8 a^4 x \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^4,x]

[Out]

-8*a^4*x + ((4*I)*a^4*Log[Cos[c + d*x]])/d + ((4*I)*a^4*Log[Sin[c + d*x]])/d - (Cot[c + d*x]*(a^2 + I*a^2*Tan[
c + d*x])^2)/d

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3541

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d*(2
*b*c - a*d)*x)/b^2, x] + (Dist[d^2/b, Int[Tan[e + f*x], x], x] + Dist[(b*c - a*d)^2/b^2, Int[1/(a + b*Tan[e +
f*x]), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]

Rule 3553

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> -Si
mp[(a^2*(b*c - a*d)*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(b*c + a*d)*(n + 1)), x] +
 Dist[a/(d*(b*c + a*d)*(n + 1)), Int[(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1)*Simp[b*(b*c*(m
- 2) - a*d*(m - 2*n - 4)) + (a*b*c*(m - 2) + b^2*d*(n + 1) - a^2*d*(m + n - 1))*Tan[e + f*x], x], x], x] /; Fr
eeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 1] && LtQ[
n, -1] && (IntegerQ[m] || IntegersQ[2*m, 2*n])

Rubi steps

\begin {align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^4 \, dx &=-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-\int -4 i a^2 \cot (c+d x) (a+i a \tan (c+d x))^2 \, dx\\ &=-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (4 i a^2\right ) \int \cot (c+d x) (a+i a \tan (c+d x))^2 \, dx\\ &=-8 a^4 x-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (4 i a^4\right ) \int \cot (c+d x) \, dx-\left (4 i a^4\right ) \int \tan (c+d x) \, dx\\ &=-8 a^4 x+\frac {4 i a^4 \log (\cos (c+d x))}{d}+\frac {4 i a^4 \log (\sin (c+d x))}{d}-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 2.27, size = 151, normalized size = 2.13 \[ \frac {a^4 \csc (c) \sec (c) \csc (c+d x) \sec (c+d x) \left (6 d x \cos (4 c+2 d x)+4 \sin (2 c) \sin (2 (c+d x)) \tan ^{-1}(\tan (5 c+d x))-i \cos (4 c+2 d x) \log \left (\cos ^2(c+d x)\right )+\cos (2 d x) \left (i \log \left (\sin ^2(c+d x)\right )+i \log \left (\cos ^2(c+d x)\right )-6 d x\right )-i \cos (4 c+2 d x) \log \left (\sin ^2(c+d x)\right )+2 \sin (2 d x)\right )}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^4,x]

[Out]

(a^4*Csc[c]*Csc[c + d*x]*Sec[c]*Sec[c + d*x]*(6*d*x*Cos[4*c + 2*d*x] - I*Cos[4*c + 2*d*x]*Log[Cos[c + d*x]^2]
+ Cos[2*d*x]*(-6*d*x + I*Log[Cos[c + d*x]^2] + I*Log[Sin[c + d*x]^2]) - I*Cos[4*c + 2*d*x]*Log[Sin[c + d*x]^2]
 + 2*Sin[2*d*x] + 4*ArcTan[Tan[5*c + d*x]]*Sin[2*c]*Sin[2*(c + d*x)]))/(4*d)

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 57, normalized size = 0.80 \[ \frac {-4 i \, a^{4} + {\left (4 i \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} - 4 i \, a^{4}\right )} \log \left (e^{\left (4 i \, d x + 4 i \, c\right )} - 1\right )}{d e^{\left (4 i \, d x + 4 i \, c\right )} - d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

(-4*I*a^4 + (4*I*a^4*e^(4*I*d*x + 4*I*c) - 4*I*a^4)*log(e^(4*I*d*x + 4*I*c) - 1))/(d*e^(4*I*d*x + 4*I*c) - d)

________________________________________________________________________________________

giac [B]  time = 3.31, size = 163, normalized size = 2.30 \[ -\frac {-8 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) + 32 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) - 8 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) - 8 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {-8 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 5 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{4}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-1/2*(-8*I*a^4*log(tan(1/2*d*x + 1/2*c) + 1) + 32*I*a^4*log(tan(1/2*d*x + 1/2*c) + I) - 8*I*a^4*log(tan(1/2*d*
x + 1/2*c) - 1) - 8*I*a^4*log(tan(1/2*d*x + 1/2*c)) - a^4*tan(1/2*d*x + 1/2*c) - (-8*I*a^4*tan(1/2*d*x + 1/2*c
)^3 - 5*a^4*tan(1/2*d*x + 1/2*c)^2 + 8*I*a^4*tan(1/2*d*x + 1/2*c) + a^4)/(tan(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x
 + 1/2*c)))/d

________________________________________________________________________________________

maple [A]  time = 0.31, size = 76, normalized size = 1.07 \[ \frac {4 i a^{4} \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {4 i a^{4} \ln \left (\sin \left (d x +c \right )\right )}{d}-8 a^{4} x -\frac {a^{4} \cot \left (d x +c \right )}{d}+\frac {a^{4} \tan \left (d x +c \right )}{d}-\frac {8 a^{4} c}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^4,x)

[Out]

4*I*a^4*ln(cos(d*x+c))/d+4*I*a^4*ln(sin(d*x+c))/d-8*a^4*x-a^4*cot(d*x+c)/d+a^4*tan(d*x+c)/d-8/d*a^4*c

________________________________________________________________________________________

maxima [A]  time = 0.72, size = 67, normalized size = 0.94 \[ -\frac {8 \, {\left (d x + c\right )} a^{4} + 4 i \, a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 4 i \, a^{4} \log \left (\tan \left (d x + c\right )\right ) - a^{4} \tan \left (d x + c\right ) + \frac {a^{4}}{\tan \left (d x + c\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

-(8*(d*x + c)*a^4 + 4*I*a^4*log(tan(d*x + c)^2 + 1) - 4*I*a^4*log(tan(d*x + c)) - a^4*tan(d*x + c) + a^4/tan(d
*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 4.00, size = 63, normalized size = 0.89 \[ \frac {a^4\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {a^4\,\mathrm {cot}\left (c+d\,x\right )}{d}-\frac {a^4\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,8{}\mathrm {i}}{d}+\frac {a^4\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,4{}\mathrm {i}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^2*(a + a*tan(c + d*x)*1i)^4,x)

[Out]

(a^4*tan(c + d*x))/d - (a^4*cot(c + d*x))/d - (a^4*log(tan(c + d*x) + 1i)*8i)/d + (a^4*log(tan(c + d*x))*4i)/d

________________________________________________________________________________________

sympy [A]  time = 0.36, size = 51, normalized size = 0.72 \[ \frac {4 i a^{4}}{- d e^{4 i c} e^{4 i d x} + d} + \frac {4 i a^{4} \log {\left (e^{4 i d x} - e^{- 4 i c} \right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2*(a+I*a*tan(d*x+c))**4,x)

[Out]

4*I*a**4/(-d*exp(4*I*c)*exp(4*I*d*x) + d) + 4*I*a**4*log(exp(4*I*d*x) - exp(-4*I*c))/d

________________________________________________________________________________________